#!/usr/bin/env python
# -*- coding:utf-- -*-
# __author__ = "liangpp"
# Date: 2023/1/20


from channels.auth import AuthMiddlewareStack
from channels.routing import ProtocolTypeRouter, URLRouter

from django.urls import re_path
from k8sWebManager.consumers import StreamConsumer
from k8sWebManager.logs_consumers import StreamLogConsumer


websocket_urlpatterns = [
    re_path(r'^workload/web_terminal/(?P<namespace>.*)/(?P<pod_name>.*)/(?P<container>.*)/', StreamConsumer.as_asgi()),
    re_path(r'^workload/log_terminal/(?P<namespace>.*)/(?P<pod_name>.*)/(?P<container>.*)/', StreamLogConsumer.as_asgi()),
]


'''
application = ProtocolTypeRouter({
    'websocket': AuthMiddlewareStack(
        URLRouter([
            re_path(r'^workload/web_terminal/(?P<namespace>.*)/(?P<pod_name>.*)/(?P<container>.*)/', StreamConsumer),
        ])
    ),
})
'''


